import 'package:dio/dio.dart';
import 'dart:async';
import 'dart:io';
import '../config/service_url.dart';

//获取首页主题内容

Future getHomePageContent() async{
  try{
    print('开始请求首页数据');
    Response response;
    Dio dio=new Dio();
    dio.options.contentType=ContentType.parse("application/x-www-form-urlencoded") as String;
    var formDate = {
      'lon':'115.02932',
      'lat':'37.76189'
    };
    response=await dio.post(servicePath['homePageContent'],data: formDate) as Response;
    if(response.statusCode == 200) {
      return response.data;
    } else {
      throw Exception('首页后台接口出现异常');
    }
  } catch(e){
    return print('Error:======>${e}');
  }
  
}